
// 审批发起
import request from '@/utils/request'

/**
 * 发起审批
 * http://10.4.15.67:3000/project/156/interface/api/3357
 * @param {*} data
 */
export function addSettlement(data) {
  return request({
    url: 'admin/settlement/addSettlement',
    method: 'post',
    data
  })
}

/**
 * 撤销审批
 * http://10.4.15.67:3000/project/156/interface/api/3339
 * @param {*} id 主键id
 */
export function cancelSettlement(id) {
  return request({
    url: 'admin/settlement/cancelSettlement',
    method: 'put',
    data: {
      id
    }
  })
}

/**
 * 获取审批数据
 * http://10.4.15.67:3000/project/156/interface/api/3366
 * @param {*} params
 */
export function getInfo(params) {
  return request({
    url: 'admin/settlement/getMerchantSettlementInfo',
    method: 'get',
    params
  })
}

/**
 * 获取审批列表
 * http://10.4.15.67:3000/project/156/interface/api/3330
 * @param {*} params
 */
export function getSettlementList(params) {
  return request({
    url: 'admin/settlement/getSettlementList',
    method: 'get',
    params
  })
}

/**
 * 财务审批导出对账明细
 * 1.审批导出明细
 * http://10.4.15.67:3000/project/156/interface/api/4860
 * @param {*} data
 */
export function exportSettlement(data) {
  return request({
    url: 'admin/settlement/exportSettlement',
    method: 'post',
    data
  })
}

/**
 * 财务审批导出对账明细列表
 * 1.对账明细
 * http://10.4.15.67:3000/project/156/interface/api/4869
 * @param {*} params
 */
export function getExportSettlementList(params) {
  return request({
    url: 'admin/settlement/getExportSettlementList',
    method: 'get',
    params
  })
}

/**
 * 财务审批导出未提交审批对账明细
 * 1.发起审批导出明细
 * http://10.4.15.67:3000/project/156/interface/api/4941
 * @param {*} data
 */
export function exportUnCommittedSettlement(data) {
  return request({
    url: 'admin/settlement/exportUnCommittedSettlement',
    method: 'post',
    data
  })
}

export default { addSettlement, cancelSettlement, getInfo }
